
cc.Class({
    extends: require('UI-PanelWindow'),

    properties: {
        content: cc.Node,
    },



    start() {
        // this.detail.active = false;
        this.turnGray();

    },

    showPlaneDetail(event, data) {
        let isGary = event.target.getChildByName('plane').getComponent(cc.Sprite)._state;
        if(isGary == 1){            
            global.EJMgr.showToast('未解锁图鉴');
            return;
        }
        let name = event.target.getComponent('BossButton').monsterName
        let bosscfg = global.DataConfig.monster[name]
        global.EJMgr.pushUI('BossHandBook/BossShow',global.Common.deepCopy(bosscfg))
    },

    turnGray() {
        let setStateValue = Math.floor(global.Data.currentPass / 2);
        setStateValue = setStateValue < 0 ? 0 : setStateValue;
        for (let i = setStateValue; i < this.content.children.length; i++) {
            this.content.children[i].getChildByName('plane').getComponent(cc.Sprite).setState(1);
        }
    },

    closePanel() {
        SoundMgr.playButtonEffect()
        global.EJMgr.popUI("BossHandBook/BossHandBook")
    },
});
